package com.lanou3g.hw0518.util;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

/**
 * If there are no bugs, it was created by Chen FengYao on 2018/5/19;
 * Otherwise, I don't know who created it either
 */

public class TestVerify {
    public static void main(String[] args) throws Exception {
        VerifyCode verifyCode = new VerifyCode();
        BufferedImage image = verifyCode.getImage();

        File file = new File("aa.jpg");
        if (file.exists()){
            file.delete();
        }

        file.createNewFile();
        OutputStream os = new FileOutputStream(file);
        verifyCode.out(image,os);

        String text = verifyCode.getText();
        System.out.println(text);
    }
}
